package com.center.enums;

import lombok.AllArgsConstructor;

/**
 * @Author dzl
 * @Date 2021/12/30 12:09 下午
 */
@AllArgsConstructor
public enum TestEnum implements EnumCenter<Integer, String> {
    /**
     * 18岁的我
     */
    DZL(18, "党真了"),
    /**
     * 19岁的我
     */
    DZL_S(19, "无敌");
    /**
     * key
     */
    private final Integer key;
    /**
     * value
     */
    private final String value;


    @Override
    public Integer getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 测试方法
     *
     * @param a key
     * @return T
     */
    public static TestEnum getEnumBykey(Integer a) {
        return EnumUtil.getEnumByKey(TestEnum.class, a);
    }

    public static void main(String[] args) {
        System.out.println(getEnumBykey(18));
    }
}
